<?php
	header('content-type:text/html;charset=utf-8');
	require 'mysqlpublic.php';
	$pic=$_POST['p'];
	if($pic=='size'){
		$sql="select * from thegood";
		$result=mysql_query($sql);
		$ar=array();
		$row=mysql_num_rows($result);
		for($i=0;$i<$row;$i++){
	        $sql_arr = mysql_fetch_assoc($result);
			$ar[$i]=array();
			array_push($ar[$i],$sql_arr['size'],$sql_arr['count'],$sql_arr['data']);
		}
		echo json_encode($ar);
	mysql_close($conn);
		
	}else if($pic=='no'){
			$sid=$_POST['id'];
		$sql="select * from goods where id='$sid'";
		$result=mysql_query($sql);
		$ar=array();
	    $sql_arr = mysql_fetch_assoc($result);
		array_push($ar,$sql_arr['goodname'],$sql_arr['price'],$sql_arr['count'],$sql_arr['imgurl'],$sql_arr['type'],$sql_arr['like'],$sql_arr['brandpic']);
		echo json_encode($ar);
	mysql_close($conn);
		
	}
?>